import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:freedom_flutter_mall/utils/theme_utils.dart';
import 'package:freedom_flutter_mall/values/color_values.dart';
import 'package:sp_util/sp_util.dart';

class ThemeProvider extends ChangeNotifier {

  ThemeMode getThemeMode(){
    final String theme = SpUtil.getString('AppTheme') ?? '';
    switch(theme) {
      case 'Dark':
        return ThemeMode.dark;
      case 'Light':
        return ThemeMode.light;
      default:
        return ThemeMode.system;
    }
  }

  ThemeData getTheme({bool isDarkMode = false}) {
    return ThemeData(
      appBarTheme: AppBarTheme(
        elevation: 0.0,
        color: isDarkMode ? Colours.dark_bg_color : Colors.white,
        systemOverlayStyle: isDarkMode ? ThemeUtils.light : ThemeUtils.dark,
      ),
    );
  }
}